﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<ERPMVC.Models.contasapagar>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Contas a pagar</h2>

    <table>
        <tr>
            <th>
                ContaID
            </th>            
            <th>
                Documento
            </th>
            <th>
                Favorecido
            </th>
            <th>
                Descrição
            </th>
            <th>
                Título
            </th>
            <th>
                Multa
            </th>
            <th>
                Juros
            </th>
            <th>
                Vencimento
            </th>
            <th>
                ContaBancariaID
            </th>
            <th>
                Pago
            </th>
            <th>
                Ação
            </th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.Encode(item.ContaID) %>
            </td>        
            <td>
                <%= Html.Encode(item.documento) %>
            </td>
            <td>
                <%= Html.Encode(item.favorecido) %>
            </td>
            <td>
                <%= Html.Encode(item.descricao) %>
            </td>
            <td>
                <%= Html.Encode(item.titulo) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:F}", item.multa)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:F}", item.juros)) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.vencimento)) %>
            </td>
            <td>
                <%= Html.Encode(item.ContaBancaria)%>
            </td>
            <td>
                <% if((bool)item.Pago == true){ %>
                Sim 
                <% }else{%>
                Não
                <%} %>
            </td>
            <td>
                <%= Html.ActionLink("Editar", "Edit", new { id=item.ContaID }) %> |
                <%= Html.ActionLink("Detalhes", "Details", new { id=item.ContaID })%> |
                <%= Html.ActionLink("Deletar", "Delete", new { id=item.ContaID })%>
            </td>
        </tr>
    
    <% } %>

    </table>
    
    <%= Html.ActionLink("Pagar Salarios", "PagarSalarios") %>
    <p>
    </p>
    <p>
        <%= Html.ActionLink("Lançar conta a pagar", "Create") %>
    </p>

</asp:Content>

